home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 11 / FM Towns Free Software Collection 11.iso / t_os / lib / yotpin / src / mk_costb.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-20  |  450 b   |  23 lines

  1. #include    <stdio.h>
  2. #include    <math.h>
  3.  
  4. void main()
  5. {
  6.     int i;
  7.     
  8.     printf("/*\n*    cos table\n*\n*/\n");
  9.     printf("#define    sin256( rad )    ( cosTbl[((rad)+64)& 0xff] )\n" );
  10.     printf("#define    cos256( rad )    ( cosTbl[ (rad)    & 0xff] )\n" );
  11.     
  12.     printf("\nstatic int cosTbl[] = {\n\t");
  13.     
  14.     for( i=0; i<256; i++ )
  15.     {    printf( "0x%08x, ", (int)(256*cos( (float)(_PI*i/128) )) );
  16.         
  17.         if( (i&3)== 3 )
  18.             printf("\n\t");
  19.     }
  20.     printf("};\n");
  21.     
  22. }
  23.